#include <stdio.h>
#include <stdlib.h>

void write_file(){
    FILE *p;
    p = fopen("e:\\aa.txt","a+");


    if(p == NULL){
        printf("file opened fail!\n");
        return;
    }
    //fseek( ,SEEK_END);

    fputs("Hello",p);

    fclose(p);


}

void read_file(){
    char fileName[] ="E:\\c_study\\a03_sort\\quick.c";
    char writeFile[] = "E:\\aa.txt";

    FILE *p=fopen(fileName,"r");
    FILE *q=fopen(writeFile,"w");
    char buffer[255]="";

    while(fgets(buffer,255,p)){
        fputs(buffer,q);
    };

    fclose(p);
    fclose(q);

}


int main()
{
    // write_file();
    read_file();
    return 0;
}
